package com.gmail.blackdog1987.onedollar.dao;

import com.gmail.blackdog1987.onedollar.dao.hibernate.EntityHibernateDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.BaseJdbcDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.JdbcUtil;
import com.gmail.blackdog1987.onedollar.entity.TGoodsOnedollarEntity;
import com.gmail.blackdog1987.onedollar.entity.TOnedollarTicketEntity;
import com.gmail.blackdog1987.onedollar.entity.base.Page;
import com.gmail.blackdog1987.onedollar.vo.GoodsOneDollarVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Repository("oneDollarTicketDao")
public class OneDollarTicketDao extends EntityHibernateDao<TOnedollarTicketEntity>{
    @Autowired
    BaseJdbcDao baseJdbcDao;
    public List<TOnedollarTicketEntity> queryFinished(Date time){
        String selectionSql = "select * from t_onedollar_ticket where onedollar_id in (select id from t_goods_onedollar where need = fill and endtime is null)";

        return JdbcUtil.queryForList(baseJdbcDao, TOnedollarTicketEntity.class, selectionSql, new Object[]{});
    }
}
